<?php
session_save_path('sessions');
session_start();

// Check if we're in a valid session
// If we are, then we go to login_success.php to be routed accordingly.
if( !isset($_SESSION['user']) || $_SESSION['user'] == null )
    include("include/header.php");
    
else
    header("location:login_success.php");

?>



<body>
  <div id="wrapper">
    <div id="header"> </div>
    <div id="left">
      <div id="logo">
        <h1>Home Sale</h1>
        <p>Only By Owner</p>
      </div>
      <div id="nav">
        <ul>
          <li class="important"><a href="index.php">Home</a></li>
          <li><a href="main_login.php">Login</a></li>
          <li><a href="register.php">Register</a></li>
          <li><a href="searchhouse.php">Search House</a></li>
          <li><a href="logout.php">Logout</a></li>
        </ul>
      </div>
      <div id="news">
        <?php include("adgeneratorleft1.php");?>
        <div class="hr-dots"> </div>
        <?php include("adgeneratorleft2.php");?>
      </div>
      <div id="support"></div>
    </div>
    <div id="right">
      <h2>Welcome to Our Site!</h2>
      <div id="welcome">
                <p>Please log in to continue</p>
                <?php
                    if(isset($_SESSION['creationConfirmed'])) {
                        ?><div id="error"><?php echo $_SESSION['creationConfirmed'];?></div>
                    <?php
                        unset($_SESSION['creationConfirmed']);
                    }?>
      </div>
    </div>
    <div class="clear"> </div>
    <div id="spacer"> </div>
    <div id="footer">
      <div id="copyright">
        &copy; Template taken from http://www.freewebsitetemplates.com/
      </div>
	  <div id="footerline"></div>
    </div>
	
  </div>
</body>
</html>